import Vue from 'vue' // 引入Vue
import Router from 'vue-router' // 引入vue-router

// Vue全局使用Router
Vue.use(Router);

const routes: any = [
  {
    path: '/',
    redirect: '/code',
  },
  {
    path: '/',
    component: () => import('@/pages/index.vue'),
    children: [
      {
        path: '/code',
        name: 'code',
        component: () => import('@/pages/code.vue')
      },
      {
        path: '/pie',
        name: 'pie',
        component: () => import('@/pages/pie.vue')
      }
      ,
      {
        path: '/his',
        name: 'his',
        component: () => import('@/pages/his.vue')
      }
      ,
      {
        path: '/line',
        name: 'line',
        component: () => import('@/pages/line.vue')
      }
      ,
      {
        path: '/area',
        name: 'area',
        component: () => import('@/pages/area.vue')
      }
      ,
      {
        path: '/splashes',
        name: 'splashes',
        component: () => import('@/pages/splashes.vue')
      },
      {
        path: '/pyramid',
        name: 'pyramid',
        component: () => import('@/pages/pyramid.vue')
      }
      ,
      {
        path: '/other',
        name: 'other',
        component: () => import('@/pages/other.vue')
      }
    ]
  },
]

export const router = new Router({
  mode: 'history',
  routes
})
